package com.jiang.jetpackdemo.database

import androidx.room.*
import com.jiang.jetpackdemo.model.NewsInfo

/**
 *
 * @ProjectName:    JetpackDemo
 * @ClassName:      NewsInfoDao
 * @Description:     java类作用描述
 * @Author:         江
 * @CreateDate:     2020/4/7 12:06
 */

@Dao
interface NewsInfoDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(vararg newsInfo: NewsInfo)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insertAll(list: MutableList<NewsInfo>)

    @Query("select * from news")
    fun queryAll(): MutableList<NewsInfo>

    @Delete
    fun delete(vararg newsInfo: NewsInfo)

}